import matplotlib.pyplot as plt
from PIL import Image, ImageDraw
import os
import cv2
import numpy as np
from deepface import DeepFace
#
# models_name = ["VGG-Face", "Facenet", "Facenet512", "OpenFace",
#                "DeepFace", "DeepID", "ArcFace", "Dlib", "SFace", 'Ensemble']
#
# model_name = models_name[5]
# result = DeepFace.verify(img1_path="../images/5.jpg",
#                          img2_path="../images/6.jpg",
#                          model_name=model_name)
# # # 展示结果，两个人不是同一个人
# print(result.verified)

result = DeepFace.extract_faces(img_path="../images/5.jpg", align=True)
print(result)

# 人脸检测和对齐
# detected_face = DeepFace.detectFace("../images/5.jpg", detector_backend="opencv",enforce_detection = True, align = True)
# print(detected_face)

# from deepface import DeepFace
#
# facerep = DeepFace.represent("../images/5.jpg", model_name='VGG-Face',  enforce_detection=True,
#                              detector_backend='opencv', align=True, normalization='base')
#
# print(facerep)